load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
load("//pkg/util/interval/generic:gen.bzl", "gen_interval_btree")

go_library(
    name = "span",
    srcs = [
        "doc.go",
        "frontier.go",
        "frontier_fuzz.go",
        "llrb_frontier.go",
        "test_helper.go",
        ":btreefrontierentry_interval_btree.go",  #keep
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/util/span",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/keys",
        "//pkg/roachpb",
        "//pkg/util/buildutil",
        "//pkg/util/envutil",
        "//pkg/util/hlc",
        "//pkg/util/interval",
        "//pkg/util/metamorphic",
        "//pkg/util/randutil",
        "//pkg/util/syncutil",
        "@com_github_cockroachdb_errors//:errors",
    ],
)

go_test(
    name = "span_test",
    size = "large",
    srcs = [
        "frontier_test.go",
        ":btreefrontierentry_interval_btree_test.go",  #keep
    ],
    data = glob(["testdata/**"]),
    embed = [":span"],
    deps = [
        "//pkg/roachpb",
        "//pkg/testutils",
        "//pkg/testutils/skip",
        "//pkg/util/encoding",
        "//pkg/util/hlc",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/randutil",
        "//pkg/util/timeutil",  #keep
        "@com_github_stretchr_testify//require",
    ],
)

gen_interval_btree(
    name = "frontier_interval_btree",
    package = "span",
    type = "*btreeFrontierEntry",
)
